﻿using System;

namespace DataAccessLayer
{
    using System.Collections.Generic;
    
    /// <summary>
    /// Class that defines task
    /// </summary>
    public class Task : WorkItem
    {
        /// <summary>
        /// project name
        /// </summary>
        public string ProjectName { get; set; }
        /// <summary>
        /// Constructor of task
        /// </summary>
        /// <param name="id">Task's id</param>
        /// <param name="name">Task's name</param>
        /// <param name="description">Task's description</param>
        /// <param name="attach">Array of attached files</param>
        /// <param name="assign">Responsible for executing task person</param>
        /// <param name="status">Task's status (New/InProgress/Done)</param>
        /// <param name="projectName">Project's neme this task assigned to</param>
        /// <param name="dateTask">Task's start date</param>
        /// <param name="comments">List of comments for that task</param>
        public Task(int id, string name, string description, object[] attach, User assign, Statuses status, string projectName, DateTime dateTask, List<Comment> comments)
        {
            Id = id;
            Name = name;
            Description = description;
            Attachments = attach;
            AssignedTo = new User(assign.Id, assign.LastName, assign.FirstName, assign.Login, assign.Password, (int) assign.Role);
            Status = status;
            DateTask = dateTask;
            ProjectName = projectName;
            Comments = comments;
        }     
    }
}
